import {Directive, ElementRef, EventEmitter, HostListener, Input, Output} from '@angular/core';

@Directive({
    selector: '[appMoveElement]'
})
export class MoveElementDirective {
    move = false;

    @Input('id') id;
    @Output() onMouseDown = new EventEmitter<any>();

    @HostListener('mousedown', ['$event']) mouseDown($event) {
        this.onMouseDown.emit({event: $event, id: this.id});
    }

    constructor(private el: ElementRef ) {

    }

}
